Denizen Script Events


Events are a way to listen to things that happened on your server and respond to them through a script. These usually pair with 'world' script containers.
Learn about how events work in The Beginner's Guide.


Showing 1 out of 382 events...
Nameprojectile hits
Event Lines <projectile> hits
TriggersWhen a projectile hits a block or an entity.
Generated Exampleson projectile hits:
after arrow hits:
Has Playerwhen the entity that was hit is a player, or when the shooter is a player if no entity was hit. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Has NPCwhen the entity that was hit is a npc, or when the shooter is a npc if no entity was hit.
Switchesentity:<entity> to only process the event if an entity got hit, and it matches the specified EntityTag matcher.
block:<block> to only process the event if a block got hit, and it matches the specified LocationTag matcher.
shooter:<entity> to only process the event if the projectile was shot by an entity, and it matches the specified EntityTag matcher.
Contexts<context.projectile> returns an EntityTag of the projectile.
<context.hit_entity> returns an EntityTag of the entity that was hit, if any.
<context.hit_block> returns a LocationTag of the block that was hit, if any.
<context.hit_face> returns a LocationTag vector of the hit normal (like '0,1,0' if the projectile hit the top of a block).
<context.shooter> returns an EntityTag of the entity that shot the projectile, if any.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
Synonyms (Search Aid)entity shoots
GroupEntity
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/entity/ProjectileHitScriptEvent.java#L17